import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:ty_smart_watch/common/images_url.dart';

class CarControl extends StatelessWidget {
  double buttonSize = 60;
  TextStyle _textStyle = TextStyle(height: 1, fontSize: 10, color: Color(0xFF71787C));

  @override
  Widget build(BuildContext context) {
    return Stack(
      textDirection: TextDirection.rtl,
      children: [
        Image.asset(
          CAR_BACKGROUND,
          fit: BoxFit.contain,
          height: 300,
          width: double.infinity,
        ),

        // 左侧按钮列
        Positioned(
          top: 0,
          bottom: 0,
          left: 0,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: [
              // 按钮1
              Column(
                children: [
                  IconButton(
                    onPressed: () {},
                    icon: Image.asset(
                      ICON_CAR_POWER_ON,
                      width: buttonSize,
                    ),
                    padding: EdgeInsets.zero,
                  ),
                  Text(
                    "一键启动",
                    style: _textStyle,
                  ),
                ],
              ),
              // 按钮2
              Column(
                children: [
                  IconButton(
                    onPressed: () {},
                    icon: Image.asset(
                      ICON_CAR_DOOR_OFF,
                      width: buttonSize,
                    ),
                    padding: EdgeInsets.zero,
                  ),
                  Text(
                    "开关车门",
                    style: _textStyle,
                  ),
                ],
              ),
              // 按钮3
              Column(
                children: [
                  IconButton(
                    onPressed: () {},
                    icon: Image.asset(
                      ICON_FIND_CAR_ON,
                      width: buttonSize,
                    ),
                    padding: EdgeInsets.zero,
                  ),
                  Text(
                    "一键寻车",
                    style: _textStyle,
                  ),
                ],
              ),
            ],
          ),
        ),
        // 右侧按钮列
        Positioned(
          top: 0,
          bottom: 0,
          right: 0,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: [
              // 按钮1
              Column(
                children: [
                  IconButton(
                    onPressed: () {},
                    icon: Image.asset(
                      ICON_CAR_WINDOW_OFF,
                      width: buttonSize,
                    ),
                    padding: EdgeInsets.zero,
                  ),
                  Text(
                    "开关车窗",
                    style: _textStyle,
                  ),
                ],
              ),

              // 按钮2
              Column(
                children: [
                  IconButton(
                    onPressed: () {},
                    icon: Image.asset(
                      ICON_CAR_AC_OFF,
                      width: buttonSize,
                    ),
                    padding: EdgeInsets.zero,
                  ),
                  Text(
                    "车内空调",
                    style: _textStyle,
                  ),
                ],
              ),
              // 按钮3
              Column(
                children: [
                  IconButton(
                    onPressed: () {},
                    icon: Image.asset(
                      ICON_CAR_BACKDOOR_ON,
                      width: buttonSize,
                    ),
                    padding: EdgeInsets.zero,
                  ),
                  Text(
                    "开启尾箱",
                    style: _textStyle,
                  ),
                ],
              ),
            ],
          ),
        ),
      ],
    );
  }
}
